using System;
using Server.Items;
using Server.Network;

namespace Server.Items
{
    public abstract class LingottoBase : BaseIngot
    {
		[Constructable]
        public LingottoBase(CraftResource resource, int amount) 
            : base(resource, amount)
		{
		}

        public LingottoBase(Serial serial)
            : base(serial)
        {
        }
        public new virtual void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
        }

        public new virtual void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
        }	


        public override void AddNameProperty(ObjectPropertyList list)
        {
            String lingotto_i = (Amount == 1) ? "lingotto" : "lingotti";

            list.Add(Amount.ToString() + " " + lingotto_i + " di " + LingottoToString(this));
        }

        public override void GetProperties(ObjectPropertyList list)
        {
            AddNameProperty(list);
        }

        public static String LingottoToString(LingottoBase lingotto)
        {
            String ret = "indefinito";

            if (lingotto is LingottoFerro)
                ret = "ferro";
            else if (lingotto is LingottoRame)
                ret = "rame";
            else if (lingotto is LingottoArgento)
                ret = "argento";
            else if (lingotto is LingottoBronzo)
                ret = "bronzo";
            else if (lingotto is LingottoOro)
                ret = "oro";
            else if (lingotto is LingottoAcciaio)
                ret = "acciaio";
            else if (lingotto is LingottoShadow)
                ret = "shadow";
            else if (lingotto is LingottoTitanio)
                ret = "titanio";
            else if (lingotto is LingottoElectrum)
                ret = "electrum";
            else if (lingotto is LingottoOrchish)
                ret = "orchish";
            else if (lingotto is LingottoMitheril)
                ret = "mitheril";
            else if (lingotto is LingottoAgapite)
                ret = "agapite";
            else if (lingotto is LingottoHolyargon)
                ret = "holyargon";
            else if (lingotto is LingottoAdamantio)
                ret = "adamantio";
            else if (lingotto is LingottoArgon)
                ret = "argon";

            return ret;
        }
    }

	[FlipableAttribute( 0x1BF2, 0x1BEF )]
	public class LingottoFerro : LingottoBase
	{
		[Constructable]
		public LingottoFerro() : this( 1 )
		{
		}

		[Constructable]
		public LingottoFerro( int amount ) : base( CraftResource.Ferro, amount )
		{
		}

        public LingottoFerro(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}	
	}

    public class LingottoArgento : LingottoBase
    {
        [Constructable]
        public LingottoArgento()
            : this(1)
        {
        }

        [Constructable]
        public LingottoArgento(int amount)
            : base(CraftResource.Argento, amount)
        {
        }

        public LingottoArgento(Serial serial)
            : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

	[FlipableAttribute( 0x1BF2, 0x1BEF )]
	public class LingottoAcciaio : LingottoBase
	{
		[Constructable]
		public LingottoAcciaio() : this( 1 )
		{
		}

		[Constructable]
		public LingottoAcciaio( int amount ) : base( CraftResource.Acciaio, amount )
		{
		}

        public LingottoAcciaio(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}	
	}

	[FlipableAttribute( 0x1BF2, 0x1BEF )]
	public class LingottoRame : LingottoBase
	{
		[Constructable]
		public LingottoRame() : this( 1 )
		{
		}

		[Constructable]
		public LingottoRame( int amount ) : base( CraftResource.Rame, amount )
		{
		}

        public LingottoRame(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}	
	}

	[FlipableAttribute( 0x1BF2, 0x1BEF )]
	public class LingottoBronzo : LingottoBase
	{
		[Constructable]
		public LingottoBronzo() : this( 1 )
		{
		}

		[Constructable]
		public LingottoBronzo( int amount ) : base( CraftResource.Bronzo, amount )
		{
		}

        public LingottoBronzo(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}	
	}

	[FlipableAttribute( 0x1BF2, 0x1BEF )]
	public class LingottoOro : LingottoBase
	{
		[Constructable]
		public LingottoOro() : this( 1 )
		{
		}

		[Constructable]
        public LingottoOro(int amount) : base(CraftResource.Oro, amount)
		{
		}

		public LingottoOro( Serial serial ) : base( serial )
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}		
	}

	[FlipableAttribute( 0x1BF2, 0x1BEF )]
	public class LingottoShadow : LingottoBase
	{
		[Constructable]
		public LingottoShadow() : this( 1 )
		{
		}

		[Constructable]
		public LingottoShadow( int amount ) : base( CraftResource.Shadow, amount )
		{
		}

        public LingottoShadow(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}		
	}

	[FlipableAttribute( 0x1BF2, 0x1BEF )]
	public class LingottoTitanio : LingottoBase
	{
		[Constructable]
		public LingottoTitanio() : this( 1 )
		{
		}

		[Constructable]
		public LingottoTitanio( int amount ) : base( CraftResource.Titanio, amount )
		{
		}

        public LingottoTitanio(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}		
	}

	[FlipableAttribute( 0x1BF2, 0x1BEF )]
	public class LingottoElectrum : LingottoBase
	{
		[Constructable]
		public LingottoElectrum() : this( 1 )
		{
		}

		[Constructable]
		public LingottoElectrum( int amount ) : base( CraftResource.Electrum, amount )
		{
		}

        public LingottoElectrum(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
	}

	[FlipableAttribute( 0x1BF2, 0x1BEF )]
	public class LingottoOrchish : LingottoBase
	{
		[Constructable]
		public LingottoOrchish() : this( 1 )
		{
		}

		[Constructable]
		public LingottoOrchish( int amount ) : base( CraftResource.Orchish, amount )
		{
		}

        public LingottoOrchish(Serial serial) : base(serial)
		{
		}

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );

			writer.Write( (int) 0 ); // version
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
		}
	}

    [FlipableAttribute(0x1BF2, 0x1BEF)]
    public class LingottoMitheril : LingottoBase
    {
        [Constructable]
        public LingottoMitheril() : this(1)
        {
        }

        [Constructable]
        public LingottoMitheril(int amount) : base(CraftResource.Mitheril, amount)
        {
        }

        public LingottoMitheril(Serial serial) : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    [FlipableAttribute(0x1BF2, 0x1BEF)]
    public class LingottoAgapite : LingottoBase
    {
        [Constructable]
        public LingottoAgapite() : this(1)
        {
        }

        [Constructable]
        public LingottoAgapite(int amount)
            : base(CraftResource.Agapite, amount)
        {
        }

        public LingottoAgapite(Serial serial) : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    [FlipableAttribute(0x1BF2, 0x1BEF)]
    public class LingottoHolyargon : LingottoBase
    {
        [Constructable]
        public LingottoHolyargon()
            : this(1)
        {
        }

        [Constructable]
        public LingottoHolyargon(int amount) : base(CraftResource.Holyargon, amount)
        {
        }

        public LingottoHolyargon(Serial serial) : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    [FlipableAttribute(0x1BF2, 0x1BEF)]
    public class LingottoAdamantio : LingottoBase
    {
        [Constructable]
        public LingottoAdamantio() : this(1)
        {
        }

        [Constructable]
        public LingottoAdamantio(int amount) : base(CraftResource.Adamantio, amount)
        {
        }

        public LingottoAdamantio(Serial serial) : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    [FlipableAttribute(0x1BF2, 0x1BEF)]
    public class LingottoArgon : LingottoBase
    {
        [Constructable]
        public LingottoArgon() : this(1)
        {
        }

        [Constructable]
        public LingottoArgon(int amount): base(CraftResource.Argon, amount)
        {
        }

        public LingottoArgon(Serial serial) : base(serial)
        {
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }
}